package cn.yiufung.designPattern.factory;

/**
 * @author 姚锋
 * @createTime 2023年08月25日 11:20:00
 */
public class ShapeFactory {
    public static Shape getShape(ShapeEnum shape){
        switch (shape){
            case CIRCLE:
                return new Circle();
            case TRIANGLE:
                return new Triangle();
            case RECTANGLE:
                return new Rectangle();
            default:
                return null;
        }
    }
}
